<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html style="background: #eee;">
	<head>
	<meta charset="utf-8">
  <title>社区评论</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="layui/css/layui.css"  media="all">
   <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/common.css">
  <link rel="stylesheet" href="css/myLayui.css">
  <link rel="stylesheet" href="css/mycss.css">
    <link rel="stylesheet" href="css/personal.css">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
	</head>
  <body class="layui-layout-body">
    
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header" style="background:#1E89E0 ">
              <ul class="layui-nav" style="padding-left: 100px">
             <div class="w">
             <span class="logo" style="margin-right:0px"><img src="img/logo.png" alt=""></span>
		        <li class="layui-nav-item"><a href="is.do">首页</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment01">蔡塘悦舍</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment02">悦舍大院</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment03">悦舍阔居</a></li>
		        <li class="layui-nav-item"><a href="ts.do?op=query">社区生活</a></li>
		        <li class="layui-nav-item"><a href="is.do?op=about">关于悦舍</a></li>
        <li class="layui-nav-item"><a href="is.do?op=aboutus">关于我们</a></li>
                <li class="layui-nav-item user">
                  <a href=""><img src="<%=request.getAttribute("personImg") %>" class="layui-nav-img"><%=request.getAttribute("personNickName") %></a>
                  <dl class="layui-nav-child">
                      <dd><a href="us.do?op=queryPerson">个人中心</a></dd>
                      <dd><a href="us.do?op=updpwd1">密码修改</a></dd>
                      <dd><a href="us.do?op=removesession">退出</a></dd>
                  </dl>
                  </li>
                  </div>
            </ul>
        </div>
        
        <div class="layui-side layui-bg-black" >

          <div class="layui-side-scroll">
             
            <!-- 头像 -->
            <div class="head-bg">
              <div class="head-pic">
                  <img src="<%=request.getAttribute("personImg") %>" class="layui-nav-img">
              </div>
              <div class="username">昵称：<span><%=request.getAttribute("personNickName") %></span></div>
           
          </div>

            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
              <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">个人信息</a>
                <dl class="layui-nav-child">
                  <dd><a href="us.do?op=queryPerson">我的资料</a></dd>
                  <dd><a href="us.do?op=updpwd1">修改密码</a></dd>

                </dl>
              </li>
              <li class="layui-nav-item"><a href="us.do?op=queryBypage">查询房租水电</a></li>
              <li class="layui-nav-item  layui-this"><a href="us.do?op=queryMsg">社区评论</a></li>
              <li class="layui-nav-item"><a href="us.do?op=queryFix">故障报修</a></li>
            </ul>
          </div>
        </div>
        
        <div class="layui-body">
          <!-- 内容主体区域 -->
          <div class="layui-fluid">
              <div class="layui-row layui-col-space15">
                <div class="layui-col-md8" id="ps_right">
                  <div class="layui-card">
                    <div class="layui-card-header">社区评论</div>
                    <div class="layui-card-body" pad15>
                      <!-- 社区评论 -->
                      <div class="layui-fluid layadmin-message-fluid">
                          <div class="layui-row">
                            <div class="layui-col-md12">
                            
                            	<!-- 发布评论表单提交 -->
                              <form class="layui-form" action="us.do?op=addmsg" method="post">
                              
                             <!--   <div class="form-group">
										<label for="priceRemark" class="col-sm-5 control-label"></label>
									<div class="layui-input-block">
										<input type="text"  placeholder="  请输入标题" lay-verify="required" class="form-control" id="articleTitle"
										 name="articleTitle">
									</div>	
								</div>  -->
                               <div class="layui-form-item">                    
                          <div class="col-sm-6">
                            <input type="text" name="articleTitle" lay-verify="required" placeholder="  请输入标题" lay-verType="tips" class="layui-input">
                          </div>
                        </div>
                                <div class="layui-form-item layui-form-text">
                                  <div class="layui-input-block">
                                    <textarea name="articleContent" id="articleContent" placeholder="  请输入内容" lay-verify="required" class="layui-textarea" ></textarea>
                                  </div>
                                </div>
                        
                                <div class="layui-form-item" style="overflow: hidden;">
                                  <div class="layui-input-block layui-input-right">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">发表</button>
                                  </div>
                                  <div class="layadmin-messag-icon">
                                    <a href="javascript:;"><i class="layui-icon layui-icon-face-smile-b"></i></a>
                                    <a href="javascript:;"><i class="layui-icon layui-icon-picture"></i></a>
                                    <a href="javascript:;"><i class="layui-icon layui-icon-link"></i></a>
                                  </div>
                                </div>
                              </form>
                            </div>
            <!-- 社区评论展示 -->            
          <div class="table-responsive" >
            <table class="table table-striped">
             
              <tbody>
       
       <c:if test="${requestScope.pageData!=null}">
       
       <c:forEach var="msg" items="${requestScope.pageData.getData()}">

                 <div class="media-body">
                     <a href="javascript:;" class="media-left" style="float: left;">
                    <img src="${msg.personImg}" height="46px" width="46px">
                    </a>
                    <div class="pad-btm">
                     <p class="fontColor">${msg.userName}</p>
                     <p class="min-font">${msg.articleDate}</p>         
                   </div>
                  <p class="text">${msg.articleTitle}</p>
                   <p class="message-text">${msg.articleContent}</p>
                    </div>
                 <!--  橙色分割线 -->
				<hr class="layui-bg-orange">
                </c:forEach>
         </c:if>
              </tbody>
            </table>
          </div>
                            
               <!-- 分页导航栏 -->             
			    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
			</fieldset>
			<div id="demo7"></div>
			<br>
			<br>
			<br>
			<br>
			<br>
              <!-- 分页导航栏 结束--> 
                       
                            </div>
                          </div>
                        </div>
                        
                      
                    </div>
                  </div>
                </div>
              </div>
            </div>
          
        </div>
        
         <!-- <div class="layui-footer">
         
          © layui.com - 底部固定区域
        </div> -->
      </div>

<script src="layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->

<script>
//分页
layui.use(['laypage', 'layer'], function(){
  var laypage = layui.laypage
  ,layer = layui.layer;
//完整功能
  laypage.render({
    elem: 'demo7'
    ,count: ${pageData.totalCount}
  	,curr: ${pageData.page}
  	,limit: ${pageData.pageSize}
    ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
    ,jump: function(obj,first){
      if(!first)
    	  {
    	  location.href="us.do?op=queryMsg&page="+obj.curr+"&limit="+obj.limit;
    	  }
    }
  });
});
</script>


    <!-- 个人小菜单 -->
    <script>
      layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        //监听导航点击
        element.on('.layui-nav', function(elem){
          //console.log(elem)
          layer.msg(elem.text());
        });
      });
      </script>
      
	</body>
	
	  <!-- 添加社区评论成功弹窗提示5 -->
	<% if(request.getAttribute("defeat5")!=null){
	  %>
	  <script type="text/javascript">
	  layui.use('layer', function(){
		  var layer = layui.layer;
		  layer.msg('你已经成功发布新的评论，请在下方展示栏浏览！');
		});  

	</script>
 <% 
  }%>
</html>
